<?php
session_start();
require_once('../../include/function/config.function.php');
require_once('../../include/function/db.function.php');
require_once('../../include/function/autoload.function.php');
require_once('Log.php') ;

$tpl = new my_smarty();
//若用户已经登录,则重定向到首页
//@todo 之后可以改进为用户之前的页面
if( !empty($_SESSION['username']) ){
	$tpl->assign( 'username' , $_SESSION['username'] );
}

//处理由do_singin.php页面保存在会话中的错误信息
if( !empty($_SESSION['errors']) ){

	$tpl->assign( 'errors' , $_SESSION['errors']  );
	//清除之前的错误信息
	$_SESSION['errors'] = array();

}

try{
$db = db_connect();

$tpl->display('problem_detail.tpl');
}catch(Exception $e){
	echo $e->getMessage();
}
